import time

class person:
    username=""      #姓名
    sex=""           #性别
    age=0            #年龄
    symoney=0        #话费余额
    brand=""         #品牌
    capacity=0       #容量
    screen=0         #屏幕
    bide=0           #待机
    qwjf=0           #全部积分
    def news(self,news):#短信内容
        print(self.username,"用",self.brand,"手机给秦羽发信息：",news)
    def showme(self):#介绍自己
        print(self.username,"性别：",self.sex,"年龄",self.age,"话费还剩：",self.symoney,"用的:",self.brand,\
              "手机","手机电池容量",self.capacity,"屏幕尺寸",self.screen,"能待机高达",self.bide,"积分拥有",self.qwjf)
    def  tele(self,hours,symoney,qwjf):
        print("黑羽要给谁打电话")
        a=input("请输入电话号码：")
        if symoney<=0:
            print("手机欠费了，请速速充值！")
        elif len(a) == 0 or len(a) > 13:
            print("您输入的号码有误，请查证后再拨。")
        else:
            print("正在呼叫对方，请稍后")
            for i  in range(6):
                print("*",end="")
                time.sleep(1)
            while True:
                print(self.username,"给我打电话了，我的电话号码是：",a)
                b=input("按9挂断")
                if b == "9":
                    print("通话结束")
                    if 0< hours <=10:
                        symoney=symoney-hours*1
                        qwjf=qwjf+hours*15
                        print("黑羽话费扣了：",hours*1,"元","还剩话费",symoney,"积分剩余",qwjf,"积分")
                        break
                    elif 10 < hours <= 20:
                        symoney=symoney-hours*0.8
                        qwjf=qwjf+hours*39
                        print("黑羽话费扣了:", hours*0.8, "元", "还剩话费", symoney, "还剩", qwjf, "积分")
                        break
                    elif hours > 20:
                        symoney =symoney - hours*0.65
                        qwjf=qwjf+hours*48
                        print("黑羽话费扣了:", hours*0.65, "元", "还剩话费", symoney, "还剩", qwjf, "积分")
                        break
                else:
                    print('输错了，重来！')
    def  tele2(self,hours):
        print(self.username,"曾经给我打了,",hours,"个小时电话")


p=person()
p.username="黑羽"
p.sex="男"
p.age="18岁"
p.symoney=300
p.brand="华为"
p.capacity="5000mah"
p.screen="9.5寸"
p.bide="99h"
p.qwjf=1000


p.news("秦羽大哥，我和侯费已经度过九九重劫了，现在就去找你!")
p.showme()
p.tele(30,p.symoney,p.qwjf)
p.tele2(100)






